# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=pingcastle-cme-nxc
_repo=CrackMapExec-PingCastle
pkgname=('netexec-pingcastle' 'crackmapexec-pingcastle')
pkgver=9.16340d2
pkgrel=1
pkgdesc='NetExec & CrackMapExec module that execute PingCastle on a remote machine.'
arch=('any')
groups=('blackarch' 'blackarch-windows')
url='https://github.com/TRIKKSS/CrackMapExec-PingCastle'
license=('custom:unknown')
makedepends=('git')
source=("git+$url.git")
sha512sums=('SKIP')

pkgver() {
  cd $_repo

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package_netexec-pingcastle() {
  depends=('netexec')

  cd $_repo

  install -Dm 644 pingcastle-nxc.py \
    "$pkgdir/usr/share/netexec/nxc/modules/pingcastle.py"
}

package_crackmapexec-pingcastle() {
  depends=('crackmapexec')

  cd $_repo

  install -Dm 644 pingcastle.py \
    "$pkgdir/usr/share/crackmapexec/cme/modules/pingcastle.py"
}

